'use strict';

/**
 * @ngdoc filter
 * @name jgappApp.filter:getkey
 * @function
 * @description
 * # getkey
 * Filter in the jgappApp.
 */
angular.module('jgappApp')
    .filter('getkey', function() {
        return function(input, key) {
            var data
            if (input) {
                data = input[key]
            }
            return data;
        };
    })
    .filter('arrfilter', function() {
        return function(input) {
            var data
            if (input) {
                data = input.split(",")
            }
            return data;
        };
    }).filter('listvalueFmt', function($filter) {
        return function(input, fmt) {
            var data
            if (input) {
                if (fmt&&fmt == "Date") {
                    data = $filter("dateFmt")(input);
                } else if (fmt&&fmt == "Number") {
                    data = $filter("NBFmt")(input);
                } else {
                    data = input;
                }
            }
            return data;
        };
    });